﻿using System;
using System.Collections.Generic;
using BusinessObjects.BusinessRules;

namespace BusinessObjects.BussinessVoucher
{
    /// <summary>
    /// FixedAssetArmortization
    /// </summary>
    public class FixedAssetArmortization : BusinessObject
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="FixedAssetArmortization" /> class.
        /// </summary>
        public FixedAssetArmortization()
        {
            AddRule(new ValidateRequired("RefNo"));
            AddRule(new ValidateRequired("RefDate"));
            AddRule(new ValidateRequired("PostedDate"));
            AddRule(new ValidateRequired("RefTypeId"));
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="FixedAssetArmortization" /> class.
        /// </summary>
        /// <param name="refId">The reference identifier.</param>
        /// <param name="refNo">The reference no.</param>
        /// <param name="refDate">The reference date.</param>
        /// <param name="postedDate">The posted date.</param>
        /// <param name="refTypeId">The reference type identifier.</param>
        /// <param name="journalMemo">The journal memo.</param>
        public FixedAssetArmortization(long refId, string refNo, DateTime refDate, DateTime postedDate , decimal totalAmount, int refTypeId, string journalMemo)
            : this()
        {
            RefId = refId;
            RefNo = refNo;
            RefDate = refDate;
            PostedDate = postedDate;
            TotalAmount = totalAmount;
            RefTypeId = refTypeId;
            JournalMemo = journalMemo;
        }

        /// <summary>
        /// Gets or sets the reference identifier.
        /// </summary>
        /// <value>
        /// The reference identifier.
        /// </value>
        public long RefId { get; set; }

        /// <summary>
        /// Gets or sets the reference no.
        /// </summary>
        /// <value>
        /// The reference no.
        /// </value>
        public string RefNo { get; set; }

        /// <summary>
        /// Gets or sets the reference date.
        /// </summary>
        /// <value>
        /// The reference date.
        /// </value>
        public DateTime RefDate { get; set; }

        /// <summary>
        /// Gets or sets the posted date.
        /// </summary>
        /// <value>
        /// The posted date.
        /// </value>
        public DateTime PostedDate { get; set; }

        /// <summary>
        /// Gets or sets the total amount oc.
        /// </summary>
        /// <value>
        /// The total amount oc.
        /// </value>
        public decimal TotalAmount { get; set; }

        /// <summary>
        /// Gets or sets the reference type identifier.
        /// </summary>
        /// <value>
        /// The reference type identifier.
        /// </value>
        public int RefTypeId { get; set; }

        /// <summary>
        /// Gets or sets the journal memo.
        /// </summary>
        /// <value>
        /// The journal memo.
        /// </value>
        public string JournalMemo { get; set; }

        /// <summary>
        /// Gets or sets the journal memo.
        /// </summary>
        /// <value>
        /// The journal memo.
        /// </value>
        public long UnitId { get; set; }

        /// <summary>
        /// Gets or sets the fa armortization details.
        /// </summary>
        /// <value>
        /// The fa armortization details.
        /// </value>
        public IList<FixedAssetArmortizationDetail> FixedAssetArmortizationDetails { get; set; }
    }
}
